<template>
<itemTop :playlist="itemlist"/>
<itemListVue :musiclist="musiclist"/>
</template>
<script setup lang="ts">
import {getitemList,getmusicList} from '@/api/item'
import { ref , onMounted} from 'vue'
import { useRoute } from "vue-router";
import itemTop from '@/components/item/itemTop.vue'
import itemListVue from '@/components/item/itemList.vue';


const itemlist =ref({})
const musiclist =ref([])

onMounted( async()=>{
    const id = useRoute().query.id
    const res = await getitemList(id)
    itemlist.value=res.playlist
    console.log(res.playlist);
    sessionStorage.setItem('itemDetail',JSON.stringify(itemlist.value))
    
  const res1 = await getmusicList(id)
  musiclist.value=res1.songs
  console.log(res1.songs);
  
    
  
    
})

</script>
<style scoped>
</style>